const mysql = require("mysql");

const connection = mysql.createConnection({
  host: 'localhost',
  user: 'root',
  password: 'root',
  database: 'dbtest'  //是几个圆饼图标的数据库的名字，不是有小鲸鱼图标连接m名
});
connection.connect()

var addSql = 'INSERT INTO emp(Id,name) VALUES(0,?)'; //0 是id号
var addSqlParams = ['芳芳'];
//增
connection.query(addSql, addSqlParams, function (err, result) {
  if (err) {
    console.log('[INSERT ERROR]', err.message);
    return
  }
  console.log('INSERT ID',result);
})
